package com.tsx.controller;

import com.tsx.annotation.SpElRecord;
import com.tsx.entity.UserEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/spEl")
public class SpElController {
    @GetMapping("/singleParam")
    @SpElRecord(key = "#name")
    public String singleParam(@RequestParam("name") String name) {
        return name;
    }

    @PostMapping("/bodyParam")
    @SpElRecord(key = "#userEntity.id")
    public UserEntity bodyParam(@RequestBody UserEntity userEntity) {
        return userEntity;
    }
}
